<?php

class Model_UserMapper {
	protected $_db;
	
	public function __construct($db) {
		$this->_db = $db;
	
	}
	
	public function fetchAll() {
		$query = 'select * from user';
		$resultSet = $this->_db->query($query);
		$entries = array ();
		foreach ( $resultSet as $row ) {
			$entry = new User ();
			$entry->setId ( $row['Id'] );
			$entry->setName ( $row['name'] );
			$entries [] = $entry;
		}
		return $entries;
	}
}

